{% set messages = get_flashed_messages(request) %}
{% if messages %}
  <div class="mb-4">
    {% for msg in messages %}
      <div class="
        {% if msg.category == 'success' %} bg-green-100 border-green-400 text-green-700
        {% elif msg.category == 'error' %} bg-red-100 border-red-400 text-red-700
        {% else %} bg-blue-100 border-blue-400 text-blue-700
        {% endif %}
        border px-4 py-3 rounded relative" role="alert">
        <span class="block sm:inline">{{ msg.message }}</span>
      </div>
    {% endfor %}
  </div>
{% endif %}